package Str;

import java.util.Arrays;

/**
 * @auther wangchenghao
 * @date 2021/6/7
 **/
public class test4 {
    public static boolean isAnagram(String s, String t) {
        if (s.length()!=t.length()){
            return false;
        }
        char[] charOne=s.toCharArray();
        char[] charTwo=t.toCharArray();
        Arrays.sort(charOne);
        Arrays.sort(charTwo);
        return Arrays.equals(charOne, charTwo);
    }


    public static void main(String[] args) {
        System.out.println("isAnagram(\"ssdsa\",\"sssda\") = " + isAnagram("ssdsa", "sssda"));
    }
}
